﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for ParkingFloor
/// </summary>
public class CarColor
{
    #region Properties
    public Guid ID { get; set; }
    public string Name { get; set; }
    public string Description { get; set; }
    public Employee LastUser { get; set; }
    public DateTime LastUpdate { get; set; }
    #endregion
    public CarColor()
    {
        //
        // TODO: Add constructor logic here
        //
        this.ID = Guid.Empty;
        this.Name = String.Empty;
        this.Description = String.Empty;
        this.LastUser = null;
        this.LastUpdate = DateTime.Now;
    }

    public IList<CarColor> GetAll()
    {
        return CarColorDAL.GetAll();
    }

    public string GetName
    {
        get
        {
            return CarColorDAL.GetName(this.ID);
        }
        
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="id">Guid</param>
    /// <returns>CardType</returns>
    public CarColor GetById(Guid id)
    {
        try
        {
            return CarColorDAL.GetById(id);
        }
        catch (Exception)
        {
            throw;
        }
    }



    /// <summary>
    /// InsertOrUpdate
    /// </summary>
    /// <param name="emp">emp</param>
    /// <returns>CardType</returns>
    public bool InsertOrUpdate(CarColor carColor)
    {
        try
        {
            return CarColorDAL.InsertOrUpdate(carColor);
        }
        catch (Exception)
        {
            throw;
        }
    }

    /// <summary>
    /// Delete
    /// </summary>
    /// <param name="id">Guid</param>
    /// <returns>bool</returns>
    public bool Delete(Guid id)
    {
        try
        {
            return CarColorDAL.Delete(id);
        }
        catch (Exception)
        {
            throw;
        }
    }

    public bool IsExistColor(string name)
    {
        try
        {
            return CarColorDAL.IsExistCardType(name);
        }
        catch (Exception)
        {
            throw;
        }
    }  
}